<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--
    对象本身的两个方法
    * get propertyName(){} 用来得到当前属性值的回调函数
    * set propertyName(){} 用来监视当前属性值变化的回调函数
-->
<script type='text/javascript'>

    var obj={
        firstname:'curren',
        lastname:'sten',
        get fullname(){
            return this.firstname+'  '+this.lastname;
        },

        set fullname(data){
            var name =data.split('');
            this.firstname=name[0];
            this.lastname=name[1];
        }
    }
    console.log(obj);
    obj.fullname='kk';
    console.log(obj);
</script>
</body>
</html>